class Messagemailer < ActionMailer::Base
  
  def contact_us(admin,contact)
    setup_contact_us(admin,contact)
    @body[:topic] = contact.contact_topic
    @body[:ms_user] = "#{contact.contact_name}"
    @body[:comment] = "#{contact.contact_comment}"
  end

  protected
  def setup_contact_us(admin,contact)
    @recipients  = admin.email
    @from        = "#{contact.contact_email}"
    @subject     = "#{contact.contact_subject}"
    @sent_on     = Time.now
    @body[:contact] = contact
  end

end
